/*
* $Id: sWindow.h 2 2009-12-23 13:58:02Z volok-aleksej@yandex.ru $
*
* Copyright 2008 by Volokitin Alexey
* All rights reserved
*
*/
#ifndef _SWINDOW_H_
#define _SWINDOW_H_

#include "Common/Parameter.h"

struct Window
{
	std::tstring m_strType;
	int m_nX;
	int m_nY;
	int m_nCX;
	int m_nCY;
	int m_nStyle;
	std::tstring m_strCaption;
	std::tstring m_strId;
	Window(const std::tstring& strType, int X, int Y, int CX, int CY, int nStyle,
		const std::tstring& strCaption, const std::tstring& strId)
		: m_strType(strType), m_nX(X), m_nY(Y), m_nCX(CX), m_nCY(CY),
		m_nStyle(nStyle), m_strCaption(strCaption),	m_strId(strId){}
	Window(const Window& win)
	{
		operator = (win);
	}
	void operator = (const Window& win)
	{
		m_strType = win.m_strType;
		m_nX = win.m_nX;
		m_nY = win.m_nY;
		m_nCX = win.m_nCX;
		m_nCY = win.m_nCY;
		m_nStyle = win.m_nStyle;
		m_strCaption = win.m_strCaption;
		m_strId = win.m_strId;
	}
};
struct sWindow
{
	Window m_window;
	std::tstring m_strState;
	std::vector<Parameter> m_aParameters;
	sWindow(Window window, const std::tstring& strState, const std::vector<Parameter>& aParameters)
		: m_window(window), m_strState(strState), m_aParameters(aParameters.begin(), aParameters.end()){}
	bool operator < (const sWindow& sWin) const{
		return _tcscoll(m_window.m_strId.c_str(), sWin.m_window.m_strId.c_str()) < 0;
	}
	bool operator == (const sWindow& sWin) const{
		return _tcscoll(m_window.m_strId.c_str(), sWin.m_window.m_strId.c_str()) == 0;
	}
	bool operator == (const std::tstring& strId) const{
		return _tcscoll(m_window.m_strId.c_str(), strId.c_str()) == 0;
	}
	bool operator == (TCHAR* strId) const{
		return _tcscoll(m_window.m_strId.c_str(), strId) == 0;
	}
};

#endif /*_SWINDOW_H_*/